package com.esri.core.internal.tasks.ags.c;

import com.esri.core.geometry.Geometry;
import com.esri.core.geometry.SpatialReference;
import com.esri.core.map.Feature;
import com.esri.core.symbol.Symbol;
import java.util.LinkedHashMap;
import java.util.Map;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class a implements Feature {
    private long a;
    private Map<String, Object> b;
    private Geometry c;
    private SpatialReference d;

    @Override // com.esri.core.map.Feature
    public Symbol getSymbol() {
        return null;
    }

    public a(long j, Map<String, Object> map, Geometry geometry, SpatialReference spatialReference) {
        this.a = -1L;
        this.a = j;
        this.b = map;
        this.c = geometry;
        this.d = spatialReference;
    }

    @Override // com.esri.core.map.Feature
    public Object getAttributeValue(String str) {
        Map<String, Object> map = this.b;
        if (map == null) {
            return null;
        }
        return map.get(str);
    }

    @Override // com.esri.core.map.Feature
    public Map<String, Object> getAttributes() {
        return this.b;
    }

    @Override // com.esri.core.map.Feature
    public long getId() {
        return this.a;
    }

    @Override // com.esri.core.map.Feature
    public Geometry getGeometry() {
        return this.c;
    }

    @Override // com.esri.core.map.Feature
    public SpatialReference getSpatialReference() {
        return this.d;
    }

    public static a a(JsonParser jsonParser, SpatialReference spatialReference, String str) throws Exception {
        Object obj;
        LinkedHashMap linkedHashMap = null;
        Geometry geometry = null;
        long j = -1;
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if ("geometry".equals(currentName)) {
                geometry = com.esri.core.internal.util.d.e(jsonParser).getGeometry();
            } else if ("attributes".equals(currentName)) {
                LinkedHashMap linkedHashMap2 = new LinkedHashMap();
                com.esri.core.internal.util.d.a(jsonParser, linkedHashMap2);
                if (str != null && (obj = linkedHashMap2.get(str)) != null) {
                    j = ((Integer) obj).intValue();
                }
                linkedHashMap = linkedHashMap2;
            } else {
                jsonParser.skipChildren();
            }
        }
        return new a(j, linkedHashMap, geometry, spatialReference);
    }
}
